import request from '@/utils/request'

// 查询参数列表
export function getCarList(query) {
  return request({
    url: '/system/cartItem/person',
    method: 'get',
    params: query
  })
}

// 添加到购物车
export function addCar(data) {
  return request({
    url: '/system/cartItem/addCart',
    method: 'post',
    data: data
  })
}


// 购物车全选
export function setCarAllSelect(data) {
  return request({
    url: '/system/cartItem/select_all',
    method: 'put',
    params: {
      isSelect: data
    }
  })
}

// 设置单个商品购物车数量
export function setCarNum(data) {
  return request({
    url: '/system/cartItem/setCartNumber',
    method: 'post',
    params: data
  })
}

// 购物车单选
export function setCarSingleSelect(data) {
  return request({
    url: '/system/cartItem/select',
    method: 'put',
    params: data
  })
}

// 删除购物车
export function delCar(ids) {
  return request({
    url: `/system/cartItem/${ids}`,
    method: 'delete',
  })
}